package org.example.adminbackend.client;

import org.example.adminbackend.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件上传服务Feign客户端
 */
@FeignClient(name = "ad-service", path = "/api/files", contextId = "fileUploadServiceClient")
public interface FileUploadServiceClient {

    /**
     * 上传文件
     */
    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<String> uploadFile(@RequestPart("file") MultipartFile file);
}